package resources;

import java.util.Vector;

import javax.swing.tree.DefaultMutableTreeNode;

import cii_lib.CCII_ACCESS_INTERF;
import cii_lib.CCII_COMPONENT;
import cii_lib.CCII_CONFIG_TABLE;

/**
 * @author promanowski
 * Class handling creation of tree models of the system.
 */
public class CiiTreeManager {
	
	/**
	 * Recursive method for creating tree component model of the system.
	 * @param comp - Root component for the (sub)tree.
	 * @return Root node of a complete subtree. 
	 */
	public static DefaultMutableTreeNode buildTreeModel(CCII_COMPONENT comp){
		DefaultMutableTreeNode node = new DefaultMutableTreeNode(comp);
		int size = comp.getChildren().size();
		for (int i = 0; i < size; i++) {
			node.add(buildTreeModel(comp.getChildren().get(i)));
		}
		return node;
	}
	
}
